const path = require("path");
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
console.log(path)
module.exports = {
    publicPath: process.env.NODE_ENV === 'production' ? '././' : './',
    outputDir: "dist/wmsj-pc/",
    assetsDir: "./static",
    productionSourceMap: false,
    parallel: false,
    lintOnSave: false,
    pluginOptions: {
        "style-resources-loader": {
            preProcessor: "less",
            patterns: [

                path.resolve(__dirname, "./src/assets/css/variable.less")
            ]
        }
    },
    devServer: {
        proxy: {
            '/api': {
                target: 'http://cmsdev.mpcheshi.com:81/',
                changeOrigin: true,
                ws: false,
                pathRewrite: {
                    '^/api': ''
                }
            },
        },
        // https: true,
        overlay: {
            warnings: true,
            errors: true,
        },
    },
    configureWebpack: {
        plugins: [
            // new UglifyJsPlugin({
            //     uglifyOptions: {
            //         compress: {
            //             drop_console: true,
            //         },
            //     },
            // }),
        ],
        externals: {

        }
    },

    css: {
        loaderOptions: {
            sass: {
                javascriptEnabled: true,
            },
            postcss: {
                plugins: [
                    require('postcss-pxtorem')({
                        rootValue: 192,
                        selectorBlackList: ['weui', 'mu'],
                        propList: ['*']
                    })
                ]
            }
        },
    },
    runtimeCompiler: true,
};


